package main

import (
	"center-platform/config"
	"center-platform/internal/event/manager"
	"center-platform/router"
	"center-platform/utils"
	"fmt"
	"github.com/gin-gonic/gin"
)

func main() {
	fmt.Println("--------读取配置信息-------")
	config.InitConfig()
	fmt.Println("--------初始化mysql-------")
	utils.InitDB()
	fmt.Println("--------初始化redis-------")
	utils.InitRedis()
	fmt.Println("--------注册事件监听器-------")
	manager.NewEventManager()
	manager.EventManager.Register()
	//manager.EventManager.TriggerEvent(constant.EventToString(constant.UserRegisterEvent), "asdasd")
	r := gin.Default()
	r.Use(gin.Recovery())
	fmt.Println("--------注册路由-------")
	router.Register(r)
}
